using SmartPeople.Framework.SecuritySpace;

namespace SmartPeople.Framework.SecuritySpace
{
    public interface ISecurityApplicationProvider
    {
        /// <summary>
        /// Create an Application controlled by Security
        /// </summary>
        /// <param name="securityApplicationName">Application Name</param>
        /// <param name="description">Description of Application</param>
        /// <returns>ISecurityApplication</returns>
        ISecurityApplication CreateApplication(string securityApplicationName, string description);

        /// <summary>
        /// Gets all applications.
        /// </summary>
        /// <returns>ISecurityApplication[]</returns>
        ISecurityApplication[] GetAllApplications();

        /// <summary>
        /// Gets the application.
        /// </summary>
        /// <param name="securityApplicationName">Name of the security application.</param>
        /// <returns>ISecurityApplication</returns>
        ISecurityApplication GetApplication(string securityApplicationName);

        /// <summary>
        /// Updates the application.
        /// </summary>
        /// <param name="securityApplicationName">Name of the security application.</param>
        void UpdateApplication(ISecurityApplication securityApplicationName);

        /// <summary>
        /// Does application exists
        /// </summary>
        /// <param name="securityApplicationName">Name of the security application.</param>
        /// <returns>bool</returns>
        bool ApplicationExists(string securityApplicationName);

        /// <summary>
        /// Deletes the application.
        /// </summary>
        /// <param name="securityApplicationName">Name of the security application.</param>
        /// <returns>bool</returns>
        bool DeleteApplication(string securityApplicationName);


        /// <summary>
        /// Deletes the application.
        /// </summary>
        /// <param name="securityApplicationName">Name of the security application.</param>
        /// <param name="throwOnPopulatedRole">if set to <c>true</c> [throw on populated role].</param>
        /// <returns>bool</returns>
        bool DeleteApplication(string securityApplicationName, bool throwOnPopulatedRole);


        /// <summary>
        /// Clears this instance.
        /// </summary>
        void Clear();
    }
}